home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
tlx_sq21.zip
/
PCB.SLT
< prev
next >
Wrap
Text File
|
1992-03-20
|
15KB
|
437 lines
//-----------------------------------------------------------
// PCB.SL? Telix script for logon to a PCBoard BBS.
//
// This script is normally called from the script LOGON.SLC.
//
// Please look at the comments through the whole file, and modify to
// suit your needs, BEFORE you use it. Then recompile with CS PCB.
//-----------------------------------------------------------
// If you have suggestions for improving this script, please suggest
// improvements to me via old-fashioned snail-mail to:
// Author: Inge Vabekk
// Hamangskogen 108
// N-1300 SANDVIKA
// NORWAY
// tel. (472) 546 396
str thisBBStype[]="PCB" // Must be PCB to work.
,line [80] // Temporary line.
,logfile [64] // Log file name.
,catfile [32] // Catalog file name.
,filelist [12] // Name of file list.
,Sdoor [2] // and door to open
,myprot [2] // My protocol
,hisprot [2] // and BBS's prot. character.
,command [10] // Current command prompt.
// For the Global storage:
,global []="GLOBAL" // Global script.
,PutLine []="PUTLINE" // PutLine script.
,bbstype []="BTYPE" // BBS type.
,short []="SHORT" // Short BBS name.
,Cprot []="CPROT" // Current protocol.
,Hprot []="HPROT" // "His" protocol.
,passw []="PASSW" // Current password.
,version []="BBSVER" // Current PCB version.
,prompt []="PROMPT" // Current command prompt.
,conf []="CONF" // Current conference.
,mscript []="MDOOR" // Name of mail door/script.
,mailup []="MAILUP" // Default PCB mail upload script
,update []="UPDATE$" // Name of update program.
;
int tol = 200 // No activity for 20 sec.
,tmark // makes script time out.
,stat
,door // Door number.
,InDoor // TRUE if in door.
,mega // MegaMail door.
,MarkM // MarkMail door.
,dbdoor // Dial-Back door.
,BBSver // PCB version
,first
,error // General error indicator
,cm // Trig on Command prompt
,pm // Trig on "Personal Mail"
,pw // Trig on password.
,Enter=13 // Code for CR.
;
//-----------------------------------------------------------
// PCBOARD logon script entered here.
//-----------------------------------------------------------
main ()
{
int i, m;
first = 1; // First time on.
entry(); // Update colors & status bar.
// Only if online.
if (!carrier())
{ failtone();
status_wind ("T²: THIS SCRIPT ONLY WORKS IF YOU'RE ONLINE!",20);
return (-1);
}
read (bbstype,line); // Get BBS type.
if (line != thisBBStype)
{ wrongBBS(); // Doesn't match script!
return (-1);
}
command = "Command"; // Set code for command prompt.
write (prompt,command); // Start tracking NOW.
pw = track ("ill echo)?", 0); // Track password.
pm = track ("ter)=yes?", 0); // Scan for personal mail?
cm = track (command, 0); // Command.
//printsc ("pw = "); printn (pw); prints (" ill echo)?");
//printsc ("pm = "); printn (pm); prints (" ter)=yes?");
//printsc ("cm = "); printn (cm); prints (" command");
read (version,line);
BBSver = subchr (line,0); // Get PCB version.
write (conf,"Main Board"); // Always starts in this conf.
read (Cprot,myprot);
if (myprot=="1")
hisprot = "O";
else if (myprot=="E") // ymodEm/g
hisprot = "G";
else if (myprot=="D") // external Dsz
hisprot = "Z";
else
hisprot = myprot;
write (Hprot,hisprot); // Write BBS protocol.
read (passw,line); // Get password.
// ****** REMEMBER: Don't use PutLine here ! *****
cputs (line);
if (BBSver < 100) // If entry from ProLogon,
{ cputs (";"); // add a semicolon,
cputs (Sdoor); // DOOR number,
cputs (";NS"); // NS
}
terminal();
cputs ("^M"); // and ENTER.
if (get_baud() < 4800) // Speed below 4800?
{ delay (2); // Delay, then terminate
cputs ("^K"); // long output with CTRL-K.
}
InDoor = BBSver < 100; // Entry from ProLogon:
if (BBSver > 144) // For PCBoard < 14.5 we should
{ door = 0; // be in door already.
InDoor = 1;
i = strposi(_entry_name,"D:",0); // Find door number from name.
if (i > 0)
{ substr (_entry_name,i+2,2,Sdoor); // Copy max. 2 characters.
door = stoi(Sdoor); // Find door number.
if (door != 0) InDoor = 0;
}
}
else // ProLogon or PBCoard < 14.5:
{ Sdoor = "1"; // Door 1 is default.
door = 1;
}
// Start tracking incoming text. For ease of reading and programming,
// this is split into different sections.
//-----------------------------------------------------------
error = 1;
SECTION1(); // Run section one.
release();
if (first) first = GetPrompt(); // Get prompt if I didn't get it.
fail:
if (!carrier()) error = 1;
if (error) return (-1);
setchr (line,0,BBSver); // Update PCB version.
setchr (line,1,0);
write (version,line);
if (dbdoor)
{ error = call ("DialBack"); // Chain to the DialBack script.
if (error) goto fail; // Can't continue.
}
line=mailup; // ASCII upload mail.
if (MarkM) // Check which door.
line="MARKMAIL"; // Chain to the MarkMail script.
else if (mega)
line="MEGAMAIL"; // Chain to the MegaMail script.
write (mscript,line); // Write name of mail script.
return (0);
}
//-----------------------------------------------------------
// Section 1: Check any happenings before first command.
//-----------------------------------------------------------
SECTION1()
{
int c // Single character.
,lfs
,novice // For tracking:
,more // "More" prompt received if TRUE.
,he // Help needed
,en // ENTER to continue
,ns // Non-stop request.
,mo // More?
,lf // Linefeed.
,dr1, dr2, dr3, dr4 // various doors.
;
dr2=dr3=dr4=mega=MarkM=dbdoor=more=novice=0; // Preset some.
dr1 = track ("ProDoor ",0); // ZIPM mail.
//printsc ("dr1 = "); printn (dr1); prints (" ProDoor");
if (door > 1)
{ dr2 = track ("M a r k M",0); // MarkMail.
dr3 = track ("ing MEGA,",0); // Megamail.
dr4 = track ("DB_DOOR ",0); // Dial-Back door.
//printsc ("dr2 = "); printn (dr2); prints (" M a r k M");
//printsc ("dr3 = "); printn (dr3); prints (" ing MEGA,");
//printsc ("dr4 = "); printn (dr4); prints (" DB_DOOR ");
}
mo = track ("p, More?",0); // More?
en = track ("r to cont",0); // Enter to continue
ns = track ("non-stop",0); // Non-stop request?
he = track (" for help",0); // Novice.
lf = track ("^J",0); // Long list? (trig on LF)
//printsc ("